<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Tenplate</title>
</head>
<body>

<div id="app">
    <!-- 伪代码 -->
    <!-- <h2 :style="{key(属性名) : value(属性值)}">{{message}}</h2> -->

    <h2 :style="{fontSize : finalSizenum+'px', backgroundColor : finalColor}">{{message}}</h2>

    <h2 :style="getStyle()">{{message}}</h2>
</div>

<script src="../js/vue.js"></script>
<script>
    const app = new Vue
    (
        {
            el : "#app",
            data : 
            {
                message : "hello",
                finalSize : '100px',
                finalSizenum : 100,
                finalColor : 'red',
            },
            methods : 
            {
                getStyle : function ()
                {
                    return {fontSize : this.finalSizenum+'px', backgroundColor : this.finalColor};
                }
            }
            
        }
    )
</script>
    
</body>
</html>